/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



            function geraMapa(){

                var directionsService = new google.maps.DirectionsService();
                var directionsDisplay = new google.maps.DirectionsRenderer();

                var map = new google.maps.Map(document.getElementById('map'), {
                    zoom:3,
                    mapTypeId: google.maps.MapTypeId.ROADMAP
                });

                directionsDisplay.setMap(map);
                directionsDisplay.setPanel(document.getElementById('panel'));
     
                //directionsDisplay.getOrigin(form.getElementById('origem'));
                //directionsDisplay.getDestination(form.getElementById('destino'));
   
                //         var request =  directionsDisplay.getOrigin(form.getElementById('origem'));
                //        var request = directionsDisplay.getDestination(form.getElementById('destino'));
            
                var request = {
                    origin: "Porto Alegre",
                    destination: "Canoas",
                    travelMode: google.maps.DirectionsTravelMode.DRIVING
                };
               
    
                directionsService.route(request, function(response, status) {
                    if (status == google.maps.DirectionsStatus.OK) {
                        directionsDisplay.setDirections(response);
                    }
                
            });
        }
        